﻿@model BlogViewModel
@{
    ViewData["Title"] = Model.Blog?.Title;
}
@section Styles{
    <link rel="stylesheet" type="text/css" href="~/css/iview-editor.css" media="all" />
}
<div id="main" class="content">
    <div class="container">
        <article id="post-1202" class="js-gallery post-1202 post type-post status-publish format-standard has-post-thumbnail hentry category-uncategorized tag-11 tag-22 tag-29">
            <style>
                .container {
                    padding: 10px 0px;
                }

                .post {
                    margin: 0 auto
                }
            </style>
            <section class="post_content">
                @if (Model.Blog != null)
                {
                    <header class="post_header">
                        <h1 class="post_title">@Model.Blog.Title</h1>
                    </header>
                    <div class="i-editor-md">
                        @Html.Raw(Model.Blog.BlogContent.Content)
                    </div>
                    <div class="meta split split--responsive cf">
                        <div class="split__title">
                            <time>@Model.Blog.Created.ToShortDateString()</time>
                            <span>
                                @if (Model.Blog.Tags != null && Model.Blog.Tags.Any())
                                {
                                    foreach (var tag in Model.Blog.Tags)
                                    {
                                        <a rel="tag" href="/Home/SearchByTag?tag=@tag.Name">@tag.Name </a>
                                    }
                                }
                            </span>
                        </div>
                        <div id="social-share"><span class="entypo-share"><i class="iconfont">&#xe614;</i>分享</span></div>
                    </div>
                }
                else
                {
                    <header class="post_header">
                        <h1 class="post_title">暂时无内容</h1>
                    </header>
                    <div class="i-editor-md">
                        欢迎您光临本站，我们没有找到您想要的内容。
                    </div>
                }
            </section>
        </article>
    </div>
    <svg id="upTriangleColor" width="100%" height="40" viewBox="0 0 100 102" preserveAspectRatio="none">
        <path d="M0 0 L50 100 L100 0 Z"></path>
    </svg>
    <div id="social">
        <ul>
            <li>
                <a href="" title="qzone" target="_blank"><i class="iconfont">&#xe67f;</i></a>
            </li>
            <li>
                <a href="" title="weibo" target="_blank"><i class="iconfont">&#xe680;</i></a>
            </li>
            <li>
                <a href="" title="douban" target="_blank"><i class="iconfont">&#xe681;</i></a>
            </li>
            <li>
                <a href="" title="twitter" target="_blank"><i class="iconfont">&#xe683;</i></a>
            </li>
        </ul>
    </div>
    <div class="navpost-part">
        <div id="NextPrevPosts">
            @if (Model.Prev != null)
            {
                <div class="prev" data-aos="slide-right" data-aos-delay="1.5s">
                    <div class="arrow"><i class="iconfont">&#xe625;</i></div>
                    <div class="preview">
                        <div class="pull-left featuredImg" style="background-image:url(@Model.Prev.Cover);"></div>
                        <a class="pull-left preview-content bold" href="/Home/Details/@Model.Prev.Id"><span>@Model.Prev.Title</span></a>
                    </div>
                </div>
            }
            @if (Model.Next != null)
            {
                <div class="next" data-aos="slide-left" data-aos-delay="1.5s">
                    <div class="arrow"><i class="iconfont">&#xe623;</i></div>
                    <div class="preview">
                        <div class="pull-right featuredImg" style="background-image:url(@Model.Next.Cover);"></div>
                        <a class="pull-right preview-content bold" href="/Home/Details/@Model.Next.Id"><span>@Model.Next.Title</span></a>
                    </div>
                </div>
            }
        </div>
    </div>
</div>
@section Scripts{
    <script type='text/javascript' src='/js/prism.js'></script>
    <script type="text/javascript">
        window.onscroll = function () {
            var scrollTop = document.body.scrollTop;
            if (scrollTop >= 200) {
                document.getElementById("NextPrevPosts").style.display = "none";
            } else {
                document.getElementById("NextPrevPosts").style.display = "block";
            }
        };
    </script>
}